import Vue from 'vue'
const log = {
  // 获取列表
  logList: function logList(ip, postdata) {
    var ipStr = ip + "/" + postdata.pageSize + "/" + postdata.number
    return Vue.http.get(ipStr, {}).then(response => {
      if (response.status === 200) {
        return Promise.resolve(response.body)
      } else {
        return Promise.reject(response.data.message)
      }
    })
  },
  // 添加通知
  noticeAdd: function noticeAdd(ip, postdata) {
    // console.log(postdata, ip)
    return Vue.http.post(ip, postdata).then(response => {
      // console.log('end')
      if (response.status === 200) {
        return Promise.resolve(response.body)
      } else {
        return Promise.reject(response.data.message)
      }
    })
  }
}

export default log
